﻿@{
    ViewBag.Title = "AllForm";
    Layout = "~/Views/Shared/_Form.cshtml";
}
<script>
    var QuaCheckSecurity = "@LeSoft.Application.Bussiness.WorkRoleSettingBLL.GetIsAudit(Convert.ToInt32(LeSoft.Application.Code.WorkRoleEnum.QuaCheckSecurity))";
    var QuaCheckCenter = "@LeSoft.Application.Bussiness.WorkRoleSettingBLL.GetIsAudit(Convert.ToInt32(LeSoft.Application.Code.WorkRoleEnum.QuaCheckCenter))";
    var keyValue = request('keyValue');
    var State = "";
    $(function () {

    })

    function Rdo_Trial(s) {
        State = s;
        if (s == 1) {
            $("#Memo").attr("disabled", "disabled");
            $("#Memo").val("");
        }
        else {
            $("#Memo").removeAttr("disabled");
        }
    }

    function AcceptClick() {
        if (!$('#form1').Validform()) {
            return false;
        }
        if (State === "") {
            dialogMsg('未选择审核结果！', 0);
            return false;
        }
        if (State == 0 && $("#Memo").val().trim() === "") {
            dialogMsg('请说明不通过原因！', 0);
            return false;
        }

        var AuditMemo = "";
        //没有权限
        if (QuaCheckSecurity == false && QuaCheckCenter == false) {
            dialogMsg('您不是该业务的处理人！', 0);
            return false;
        }
        //只有市局权限
        if (QuaCheckSecurity == "True" && QuaCheckCenter == "False") {
            AuditMemo = "将对市局审批环节单据进行批量操作，是否继续！";
        }
        //只有受理中心权限
        if (QuaCheckSecurity == "False" && QuaCheckCenter == "True") {
            AuditMemo = "将对受理中心审批环节单据进行批量操作，是否继续！";
        }
        //有市局权限、受理中心权限
        if (QuaCheckSecurity == "True" && QuaCheckCenter == "True") {
            AuditMemo = "将对市局审批环节和受理中心审批环节单据进行批量操作，是否继续！";
        }
        if (AuditMemo == "") {
            dialogMsg('没有业务权限！', 0);
            return false;
        }
        dialogConfirm(AuditMemo, function (r) {
            if (r) {
                $.SaveForm({
                    url: "../../QualificationManage/Retrial/AllCheckInfo",
                    param: { State: State, Data: keyValue, Memo: $("#Memo").val() },
                    loading: "正在保存数据...",
                    success: function () {
                        $.currentIframe().$("#gridTable").resetSelection();
                        $.currentIframe().$("#gridTable").trigger("reloadGrid");
                        dialogClose();
                    }
                });
            }
        })
    }
</script>

<table class="form" style="width:80%;margin-left:10%; margin-top:20px;">
    <tr>
        <td class="formTitle">审批结果：</td>
        <td class="formValue"> 
            &nbsp;&nbsp;<input name="Trial" id="CL_Chk" class="CL_Rdo" type="radio" onchange="Rdo_Trial(1)" value="1" />通过
            &nbsp;&nbsp;&nbsp;&nbsp;<input name="Trial" class="CL_Rdo" id="CL_UChk" onchange="Rdo_Trial(0)" type="radio" value="0" />不通过
        </td>
    </tr>
    <tr id="Try">
        <td class="formTitle">不通过原因：</td>
        <td class="formValue"><textarea class="form-control" id="Memo" style="height:100px;" isvalid="yes" checkexpession="IsScript"></textarea></td>
    </tr>

</table>

